<template>
  <div >
    <router-link v-for="(item,index) in list" :to="'/no/noticeDetail/'+item.id">
        <div >
          {{item.title}}
        </div>
    </router-link>
    <!-- <router-link  :to="'/no/noticeDetail/'">
        whp
    </router-link> -->
     <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="listQuery.page"
      :limit.sync="listQuery.limit"
      @pagination="getList"
    />
  </div>
</template>

<script>

import Pagination from '@/components/Pagination'
import { fetchList } from '@/api/notice'


export default {
  name: 'Documentation',
  components: { Pagination },
  data() {
    return {
      list: null,
      listLoading: true,
      total: 0,
      listQuery: {
        page: 1,
        limit: 20,
        sort: '+id'
      },
    }
  },
  created() {
    this.getList()
  },
  methods: {
       getList() {
      this.listLoading = true
      fetchList(this.listQuery).then((response) => {
        this.list = response.data.records
        this.total = response.data.total
        // Just to simulate the time of the request
        setTimeout(() => {
          this.listLoading = false
        }, 1.5 * 1000)
      })
    },

  }
}
</script>

<style lang="scss" scoped>

</style>
